package com.sjh.test.java8.joining;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class JoiningDemo1 {

    public static void main(String[] args) {
        List<String> list = Arrays.asList("JayLa","LayMan","KangKang","XinYI");
        String resultStr =  list.stream().collect(Collectors.joining());
        System.out.println(resultStr);
        resultStr=  list.stream().collect(Collectors.joining(","));
        System.out.println(resultStr);
        resultStr=  list.stream().collect(Collectors.joining("-","[","]"));
        System.out.println(resultStr);
    }
}
